USE [bmig_mensual_post_cadena]
GO

IF EXISTS (SELECT name FROM sysobjects WHERE name = N'[dbo].[WASP_M0002_ESTADO_TRABAJADOR]' AND type = 'P')
  DROP PROCEDURE [dbo].[WASP_M0002_ESTADO_TRABAJADOR]
GO

CREATE PROCEDURE [dbo].[WASP_M0002_ESTADO_TRABAJADOR]
AS
BEGIN
	SELECT	z07325cta as cta, 
			est = 
			CASE z07304cod
				WHEN 1 THEN 0
				ELSE 9
			END 
	INTO	est_trabajador
	FROM	z07325 (NOLOCK)
END
GO
